package com.example.crowdfunding.mapper;

import com.example.crowdfunding.entity.Role;
import com.example.crowdfunding.entity.RoleExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * The interface Role mapper.
 */
public interface RoleMapper {

    /**
     * Count by example int.
     *
     * @param example the example
     * @return the int
     */
    int countByExample(RoleExample example);

    /**
     * Delete by example int.
     *
     * @param example the example
     * @return the int
     */
    int deleteByExample(RoleExample example);

    /**
     * Delete by primary key int.
     *
     * @param id the id
     * @return the int
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * Insert int.
     *
     * @param record the record
     * @return the int
     */
    int insert(Role record);

    /**
     * Insert selective int.
     *
     * @param record the record
     * @return the int
     */
    int insertSelective(Role record);

    /**
     * Select by example list.
     *
     * @param example the example
     * @return the list
     */
    List<Role> selectByExample(RoleExample example);

    /**
     * Select by primary key role.
     *
     * @param id the id
     * @return the role
     */
    Role selectByPrimaryKey(Integer id);

    /**
     * Update by example selective int.
     *
     * @param record  the record
     * @param example the example
     * @return the int
     */
    int updateByExampleSelective(@Param("record") Role record, @Param("example") RoleExample example);

    /**
     * Update by example int.
     *
     * @param record  the record
     * @param example the example
     * @return the int
     */
    int updateByExample(@Param("record") Role record, @Param("example") RoleExample example);

    /**
     * Update by primary key selective int.
     *
     * @param record the record
     * @return the int
     */
    int updateByPrimaryKeySelective(Role record);

    /**
     * Update by primary key int.
     *
     * @param record the record
     * @return the int
     */
    int updateByPrimaryKey(Role record);

    /**
     * Select role by keyword.
     *
     * @param keyword the keyword
     * @return the list
     */
    List<Role> selectRoleByKeyword(String keyword);

    List<Role> selectAssignedRole(@Param("adminId")Integer adminId);

    List<Role> selectUnassignedRole(@Param("adminId")Integer adminId);

}